def main():
    list1 = [[1,2,3],2,3,[1,3,[12,22]],'a',12]
    j = 0
    while True:
        for i in list1:
            list2 = []
            if type(i, list):
                j += 1
                list2 = list2.append(i)
                list1 = list2
            if list2 = []
            print('这个列表嵌套了d%层‘ % j)
                break


if __name__ == '__main__'
    main()
